#include "Integer.h"
#include <sstream>

namespace TreeExpression {

Integer::Integer(long long int _data) : Expression_CRTP<Integer>(), data(_data) { }

Integer::Integer(const Integer& copy) : Expression(copy), Expression_CRTP<Integer>(copy) {
	data = copy.data;
}

Integer::~Integer() { }

AutoPointer<Expression> Integer::eval(CopyPointer<Context>&) {
	return AutoPointer<Expression>(new TreeExpression::Integer(*this));
}

long long int Integer::getData() const {
	return data;
}


std::string Integer::getHash() const {
	return "Integer";
}

std::string Integer::toString() const {
	std::ostringstream oss;
	oss << data;
	return oss.str();
}

}
